package cn.oa.service.Impl;
import cn.oa.dao.PositionDao;
import cn.oa.entity.Position;
import cn.oa.service.PositionService;
import cn.oa.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.sql.SQLException;
import java.util.List;

public class PositionServiceImpl implements PositionService {
    SqlSessionFactory sqlSessionFactory = MybatisUtil.sessionFactory;
    @Override
    public List<Position> getAllPositions() throws SQLException {
        SqlSession sqlSession=sqlSessionFactory.openSession(true);
		PositionDao positionDao=sqlSession.getMapper(PositionDao.class);
		List<Position> list=positionDao.getAllPositions();
		return list;
    }

}
